<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core" xml:lang="en" lang="en">
<h:head>
    <title>Facelet Title</title>
</h:head>
<h:body>
    <ui:composition template="BackGeneral.xhtml">
        <ui:define name="content">
            <h:form>
                <ui:include src="/AjaxStatus2.xhtml"/>

                <div style="text-align: left; margin: 10px 0px 0px 0px; width: 98%;">
                    <div>
                        <h:panelGrid columns="2" style="width:100%">
                            <h:outputText id="outputText1" styleClass="tit"
                                          value="－用户激活/启用－"/>
                        </h:panelGrid>
                    </div>
                    <p:separator></p:separator>

                    <div>
                        <p:dataTable paginator="true" paginatorPosition="bottom" id="dataTable1" styleClass="list"
                                     rows="9" style="width:100%"
                                     value="#{listClientUser.casusList}" var="Case">

                            <p:column filterBy="#{Case.username}">
                                <h:outputLink
                                        value="#{facesContext.externalContext.requestContextPath}/m/ViewClientUser.jspx?id=#{Case.id}">
                                    <h:outputText style="height: 5%" value="#{Case.username}"/>
                                </h:outputLink>
                                <f:facet name="header">
                                    <h:outputText value="用户名"/>
                                </f:facet>
                            </p:column>
                            <p:column filterBy="#{Case.name}">
                                <h:outputText style="height: 5%" value="#{Case.name}"/>
                                <f:facet name="header">
                                    <h:outputText value="姓名"/>
                                </f:facet>
                            </p:column>
                            <p:column sortBy="#{Case.regTime}">
                                <h:outputText style="height: 5%" value="#{Case.regTime}">
                                    <f:convertDateTime pattern="yyyy-MM-dd HH:mm" timeZone="GMT+8"/>
                                </h:outputText>
                                <f:facet name="header">
                                    <h:outputText value="注册时间"/>
                                </f:facet>
                            </p:column>

                            <p:column>
                                <p:commandLink rendered="#{Case.enabled}"
                                               actionListener="#{listClientUser.someAbleUser(Case.id)}" update="@form"
                                               value="禁用">
                                </p:commandLink>

                                <p:commandLink rendered="#{!Case.enabled}"
                                               actionListener="#{listClientUser.someAbleUser(Case.id)}" update="@form"
                                               value="启用">
                                </p:commandLink>

                                <f:facet name="header">
                                    <h:outputText value="启用/禁用"/>
                                </f:facet>
                            </p:column>

                            <p:column sortBy="#{Case.activated}">
                                <h:outputText style="height: 5%" rendered="#{Case.activated}"
                                              value="已激活"/>
                                <p:commandLink actionListener="#{listClientUser.activateUser(Case.id)}"
                                               rendered="#{!Case.activated}" update="@form"
                                               value="激活">
                                </p:commandLink>
                                <f:facet name="header">
                                    <h:outputText value="激活?"/>
                                </f:facet>
                            </p:column>
                            <!--
                                                            <p:column>
                                                                <p:commandLink rendered="#{!Case.markDel}"
                                                                               actionListener="#{listClientUser.someDelUser(Case.id)}" update="@form"
                                                                               value="标记删除">
                                                                </p:commandLink>
                                                                <p:commandLink rendered="#{Case.markDel}"
                                                                               actionListener="#{listClientUser.someDelUser(Case.id)}" update="@form"
                                                                               value="取消标记">
                                                                </p:commandLink>
                                                                <f:facet name="header">
                                                                    <h:outputText value="标记删除" />
                                                                </f:facet>
                                                            </p:column>
                                                            <p:column>
                                                                <p:commandLink rendered="#{Case.markDel}"
                                                                               actionListener="#{listClientUser.deleteUser(Case.id)}" update="@form"
                                                                               value="彻底删除">
                                                                </p:commandLink>
                                                                <f:facet name="header">
                                                                    <h:outputText value="彻底删除" />
                                                                </f:facet>
                                                            </p:column>

                            -->
                        </p:dataTable>
                        <p:separator></p:separator>
                        <h:outputText
                                value="注：前台用户和文件、日志等关联，为了系统安全与完整，不允许删除用户，用户有恶意行为时，可以禁用！"></h:outputText>
                    </div>
                </div>
            </h:form>
        </ui:define>
    </ui:composition>
</h:body>
</html>

